package com.googlecode.maratische.google.listeners;

import java.util.ArrayList;
import java.util.List;

import com.googlecode.maratische.google.model.Item;

public class DisplayPaneObservable {

	List<DisplayPaneListener> listeners = new ArrayList<DisplayPaneListener>();
	
	public void addObserver(DisplayPaneListener listener) {
		listeners.add(listener);
	}
	
	public void setDisplayedItem(Item item) throws Exception {
		for (DisplayPaneListener listener : listeners) {
			listener.setDisplayedItem(item);
		}
	}
	public void setText(String description) throws Exception {
		for (DisplayPaneListener listener : listeners) {
			listener.setText(description);
		}
	}
}
